const state = {
    messageCount: 0,
    menuList: [], //菜单列表
    currentPath: [
        {
            title: '首页',
            path: '/home',
            name: 'home_index'
        }
    ] 
};

const mutations = {
    updateMenulist(state, mainRouter) {
        state.menuList = mainRouter;
    },
    setCurrentPath(state, pathArr) {
        if (pathArr.length > 0) {
            state.currentPath = pathArr;
        }
    },
    setMessageCount(state, num) {
        state.messageCount = num;
    }
};

const actions = {
    addMenulist({ commit, state }, mainRouter) {
        commit('updateMenulist', mainRouter);
    }
};

const getters = {};

export default {
    state,
    getters,
    actions,
    mutations
};
